package classes;

import ontology.UMCourtLOntology;
import jade.content.onto.Ontology;
import jade.core.AID;
import jade.lang.acl.ACLMessage;
import jade.lang.acl.MessageTemplate;

public class MessageTemplates {

	AIDs aids = new AIDs();
	private Ontology ontology = UMCourtLOntology.getInstance();
	
	/**
	 * The template for log messages to be sent to the Database agent. The content of
	 * the message is a String containing the event to log.
	 */
	final public MessageTemplate LOG = 
		MessageTemplate.and(
							MessageTemplate.MatchReceiver(new AID[]{aids.DATABASEL}), 
							MessageTemplate.and(
												MessageTemplate.MatchPerformative(ACLMessage.REQUEST), 
												MessageTemplate.MatchOntology(ontology.getName())));
	
	/**
	 * The template for index messages to be sent to the Database agent. The content of
	 * the message is a list of cases to be indexed.
	 */
	final public MessageTemplate INDEX = 
		MessageTemplate.and(
							MessageTemplate.MatchReceiver(new AID[]{aids.DATABASEL}), 
							MessageTemplate.and(
												MessageTemplate.MatchPerformative(ACLMessage.REQUEST), 
												MessageTemplate.MatchOntology(ontology.getName())));
	

}
